<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
 <!-- 增加题 -->
			<div id="dialog-message" style="min-height:500px;">  
				 	 <table id="register_from">
							<tr style="display:none;">
				 	 			<td> </td>
				 	 			<td>
				 	 				 <input type="hidden" id="table_id" value="${param.table_id}">
									 <input type="hidden" id="juanId" value="${param.table_id}"><!-- 卷Id传过来的时候，也叫table_id,而更新的时候不传卷的ID-->
				 	 			</td>
				 	 		</tr>
							  
				 	 		<tr>
				 	 			<td>题名称：</td>
				 	 			<td>
				 	 				<div class="input-group">
										<input class="form-control" id="title"  value="${param.title}" name="title"  require='true'  meth="notNull,isSpace" maxlength="20"  title="名称不能为空，不能输入特殊字符"  type="text"/> 
									</div> 
				 	 			</td>
				 	 		</tr>
				 	 		<tr>
				 	 			<td>类型：</td>
				 	 			<td>
				 	 				<div class="input-group">
										<select class="form-control" id="type" name="type" style="width:150px;"> 
											<option value="0">主观题</option> 
											<option value="1">客观题</option>
										</select>
									</div> 
				 	 			</td>
				 	 		</tr>
				 	 		<tr>
				 	 			<td>所属人：</td>
				 	 			<td>
				 	 				<div class="input-group">
										<input class="form-control" type="text" id="userName" name="userName" value="${sessionScope.sysUser.userName}" disabled="disabled"/> 
									</div> 
				 	 			</td>
				 	 		</tr>
							<tr>
				 	 			<td>所属卷：</td>
				 	 			<td>
				 	 				<div class="input-group">
										<input class="form-control" type="text" id="juanName" name="juanName" value="${param.name}" disabled="disabled"/> 
									</div> 
				 	 			</td>
				 	 		</tr>
				 	 		<tr>
				 	 			<td>内容：</td>
				 	 			<td>
				 	 				<div class="input-group">
										<textarea id="content" name="content" style="width:300px;height:120px;" maxlength="300" class="autosize-transition form-control">  ${param.content}</textarea>
									</div> 
				 	 			</td>
				 	 		</tr>
							<tr>
				 	 			<td>答案：</td>
				 	 			<td>
				 	 				<div class="input-group">
										<textarea id="answerTeacher" name="answerTeacher" style="width:300px;height:120px;" maxlength="300" class="autosize-transition form-control"> ${param.answerTeacher}</textarea>
									</div> 
				 	 			</td>
				 	 		</tr>
							<tr>
				 	 			<td>题分：</td>
				 	 			<td>
				 	 				<div class="input-group">
											<input class="form-control" type="text" id="fen"  require='true'  meth="notNull,isNumber" maxlength="2" name="fen" value="${param.fen}" title="只能输入数字类型"/> 
									</div> 
				 	 			</td>
				 	 		</tr>
				 	 </table>		 
			</div>
			<!-- 增加卷结束-->
<script>
(function(){
	//增加卷
	 function addHomeWorkQuestion(contrl){
		var a =$("#register_from").hzValidate("init");  
		if(a==false){
			return;
		}else{ 
			var object = OAajaxSubmit("register_from");  
			object.juanId = $("#juanId").val();
			var url ="${pageContext.request.contextPath}/edu/sys_TestPaperAction.do?method=addTestPaperQuestion";
				$.ajax({
				   type: "POST",
				   url: url,
				   data: object,
				   dataType:'json',
				   success: function(msg){
					   alert(msg.message);
					  if(msg.code=="1"){
						    $(contrl).dialog('destroy'); 
							$("#user_include").html(""); 
							var allc1 =$("input[type=checkbox][name=sys_sys_TestPaper_table_checkbox]:checked");
							if(allc1.length>1||allc1.length<=0){
								alert("没有选中卷");
								return;
							}
							var table_id1=$(allc1[0]).parent().parent().attr("id");
							window.homeWork.loadTestPaperQuestion(null,{table_id:table_id1});
					  }
				   }
				});
			
		}
	 };
	 $(function(){ 
		 if("${param.sex}"!=""){
			 for(var i=0;i<$("#sex").find("option").length;i++){
				 if($("#sex").find("option")[i].value=="${param.sex}"){
					 $("#sex").find("option")[i].selected=true;
				 }
			 }
		 };
		 $("#showStartTime").datepicker({
				showOtherMonths: true, 
				selectOtherMonths: false,
				monthNames: [ "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月" ],
				dateFormat: "yy-mm-dd"
		 });
		 $('#timepicker1').timepicker({
				minuteStep: 1,
				showSeconds: true,
				showMeridian: false
		  });
		 $('#timepicker2').timepicker({
				minuteStep: 1,
				showSeconds: true,
				showMeridian: false
		  });
 
		 $("#showEndTime").datepicker({
				showOtherMonths: true, 
				selectOtherMonths: false,
				monthNames: [ "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月" ],
				dateFormat: "yy-mm-dd"
		 });
		 if("1"=="${param.f}"){
			 $("#table_id").remove();
		 }
	 });
	 window.homeWorkQuestion={};
	 window.homeWorkQuestion.addHomeWorkQuestion=addHomeWorkQuestion;
	
})();
</script>